<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
  <title>{$tdk['title']}</title>
  <meta name="description" content="{$tdk['description']}">
  <meta name="keywords" content="{$tdk['keywords']}">
  <meta name="author" content="alonez"/>
  <meta name="baidu-site-verification" content="code-mjNnJHp6FK"/>
  <link rel="shortcut icon" href="https://ujia-img.oss-cn-shenzhen.aliyuncs.com/beauthome/favicon.ico">
  <link href="https://res.bestyoujia.com/common/third/animate.css/4.1.1/animate.min.css" rel="stylesheet">
  <link href="https://res.bestyoujia.com/common/third/swiper/6.3.5/swiper-bundle.min.css" rel="stylesheet" >
  <script src="https://res.bestyoujia.com/common/third/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://res.bestyoujia.com/common/third/layer/3.1.1/layer.js"></script>
  <style>

    @font-face {
      font-family: 'Alibaba PuHuiTi';
      font-display: swap;
      src: url('//at.alicdn.com/t/webfont_d7y2aq69rjm.eot'); /* IE9*/
      src: url('//at.alicdn.com/t/webfont_d7y2aq69rjm.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
      url('//at.alicdn.com/t/webfont_d7y2aq69rjm.woff2') format('woff2'),
      url('//at.alicdn.com/t/webfont_d7y2aq69rjm.woff') format('woff'), /* chrome、firefox */
      url('//at.alicdn.com/t/webfont_d7y2aq69rjm.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
      url('//at.alicdn.com/t/webfont_d7y2aq69rjm.svg#Alibaba-PuHuiTi-Regular') format('svg'); /* iOS 4.1- */
    }

    body {
      max-width: 520PX;
      margin: 0 auto;
    }

    button {
      border: 0;
    }

    button:focus {
      outline: none;
    }

    button:active {
      opacity: .7;
    }

    ol, ul {
      list-style: none;
    }

    input {
      height: .6rem;
      letter-spacing: 1px;
      font-size: .28rem;
      width: 6.6rem;
      border-radius: .06rem;
      padding-left: .1rem;
      margin-top: .02rem;
      border: 1px solid #D2D2D2;
      background: #EEEEEE;
    }

    input:focus {
      outline: none;
    }

    ::-moz-placeholder {
      color: #999999;
      font-size: .28rem;
      letter-spacing: 1px;
    }

    ::-webkit-input-placeholder {
      color: #999999;
      font-size: .28rem;
      letter-spacing: 1px;
    }

    :-ms-input-placeholder {
      color: #999999;
      font-size: .28rem;
      letter-spacing: 1px;
    }

    .container {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      background-size: cover;
      position: relative;
    }

    .banner > img {
      width: 100%;
    }

    .img-fit {
      display: block;
      max-width: 100%;
      height: auto;
    }

    .order {
      border: 0;
      height: .8rem;
      letter-spacing: 1px;
      font-size: .38rem;
      width: 6.6rem;
      border-radius: .44rem;
      padding-left: .1rem;
      margin-top: .4rem;
      font-weight: bold;
      font-family: 'Alibaba PuHuiTi';
      color: #ffffff;
      background: #F4A023;
    }

    .fixed-bottom {
      position: fixed;
      width: 100%;
      bottom: 0;
      z-index: 1;
      color: #ffffff;
      display: none;
      max-width: 520px;
    }

    #order-btn:active, .float-icon:active {
      opacity: .8;
    }

    .mask-container {
      position: absolute;
      z-index: 1;
      top: 0;
      left: 0;
      width: 100%;
      height: 100vh;
      background: rgba(0, 0, 0, .4);
      display: none;
      overflow: hidden;
      min-height: 100vh;
    }

    .close-page {
      width: 4.2rem;
      height: .7rem;
      margin-top: .4rem;
      background: #1C2857;
      border-radius: 6px;
      color: #ffffff;
      font-size: .32rem
    }

    @keyframes pulse {
      from {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
      }

      50% {
        -webkit-transform: scale3d(1.3, 1.3, 1.3);
        transform: scale3d(1.3, 1.3, 1.3);
      }

      to {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
      }
    }
  </style>
  <script>
    var _hmt = _hmt || [];
    (function () {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?40c4a0b79991b779265eef34e4be9d02";
      const s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>
</head>
<body>
<section class="container">
  <div class="banner">
    <img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/banner.jpg" alt=""/>
  </div>

  <div id="form-container" style="display: flex; flex-direction: column; justify-content: center; align-items: center; margin-top: .2rem; margin-bottom: .2rem">
    <div style="display: flex; flex-direction: column; margin-top: .2rem">
      <span style="font-size: .28rem; color: #272727">您的姓名</span>
      <input id="customer" placeholder="方便称呼您">
    </div>
    <div style="display: flex; flex-direction: column; margin-top: .2rem">
      <span style="font-size: .28rem; color: #272727">小区名称</span>
      <input id="building" type="text" placeholder="领取专属案例精选">
    </div>
    <div style="display: flex; flex-direction: column; margin-top: .2rem">
      <span style="font-size: .28rem; color: #272727">您的电话</span>
      <input id="mobile" type="number" placeholder="已加密请放心填写">
    </div>
    <button class="order">立即预约  免费领取设计名额</button>
    <div style="margin: .3rem auto .4rem">
      <div style="width: 100vw;text-align: center;font-size: .18rem;font-family: 'Alibaba PuHuiTi';color: #A1A1A1;">*您的信息我们将严格保密</div>
    </div>
  </div>

  <div style="width: 100%; padding: 0 .2rem">
    <div style="margin: 0 .2rem"><img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/gift.png" alt=""/></div>
    <div class="swiper-container" style="margin-top: .5rem">
      <div class="swiper-wrapper">
        <div class="swiper-slide">
          <img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/eg1.jpg" alt=""/>
        </div>
        <div class="swiper-slide">
          <img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/eg2.jpg" alt=""/>
        </div>
        <div class="swiper-slide">
          <img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/eg3.jpg" alt=""/>
        </div>
        <div class="swiper-slide">
          <img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/eg4.jpg" alt=""/>
        </div>
        <div class="swiper-slide">
          <img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/eg5.jpg" alt=""/>
        </div>
      </div>
    </div>
    <div style="margin: .25rem auto .52rem; width: 100%; display: flex; justify-content: center; align-items: center"><img class="img-fit" style="width: 2.22rem" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/scroll.png" alt=""/></div>
    <div style="margin: 0 .2rem 1.6rem"><img class="img-fit" src="https://res.bestyoujia.com/web/ZMYJ/wxcustomized/vs.png" alt=""/></div>
  </div>
</section>

<section class="fixed-bottom">
  <div id="jump-btn" style="display: flex;align-items: center;justify-content: center;
  width: 100%;font-size: .3rem;
height: .85rem; color: #ffffff;font-family: 'Alibaba PuHuiTi';
font-weight: bold;
background: #D74243;"><span>免费领取设计名额</span><img class="animate__animated animate__pulse animate__infinite" style="width: .42rem; margin-left: .08rem" alt="" src="https://res.bestyoujia.com/web/ZMYJ/wxreply/hand.png"></div>
  <div style="height: .5rem;width: 100%;background: #ffffff;text-align: center;line-height: .5rem;
font-size: .14rem;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #797878;">*为了您的权益，您的隐私将被严格保密</div>
</section>

<section class="mask-container">
  <div style="display: flex;width: 100%; height: 100%; justify-content: center;align-items: center">
    <div class="result-wrap animated fadeIn" style="display: flex; flex-direction: column; justify-content: center; align-items: center; width: 5.4rem; height: 6.85rem; background: #FEFEFE; border-radius: .06rem">
      <div style="
   margin-left: .4rem;
font-size: .46rem;
font-weight: bold;
color: #1C2857;">获取成功！
      </div>
      <div style="
font-size: .3rem;
font-weight: 400;
color: #333333;">稍后致美优家会向您致电
      </div>
      <img alt="" style="width: 2.8rem; margin-top: .3rem" src="https://res.bestyoujia.com/web/ZMYJ/wxlanding/code.png">
      <div style="
font-size: .3rem;
font-weight: 400;
color: #333333;">扫我咨询更多福利</div>
      <button class="close-page">确定</button>
    </div>
  </div>
</section>

<script src="https://res.bestyoujia.com/common/third/js.cookie/2.2.1/js.cookie.min.js"></script>
<script src="https://res.bestyoujia.com/common/third/swiper/6.3.5/swiper-bundle.min.js"></script>
<script src="https://res.bestyoujia.com/common/assets/js/appointment.js"></script>
<script src="https://res.bestyoujia.com/web/ZMYJ/assets/js/mobile-common.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="https://res.bestyoujia.com/common/assets/js/wxShare.js"></script>
<script type="text/javascript">
  initWxShare('致美优家全屋定制，为您的生活方式设计', '{$tdk["description"]}');

  $('.mask-container').hide();

  (function (n, e) {
    const t = n.documentElement, i = "orientationchange" in window ? "orientationchange" : "resize", d = function () {
      let n = t.clientWidth;
      if(n > 520) {
        n = 520;
      }
      n && (t.style.fontSize = n / 7.5 + "px")
    };
    n.addEventListener && (e.addEventListener(i, d, !1));
    n.addEventListener && n.addEventListener("DOMContentLoaded", d, !1);
  })(document, window);

  Array.prototype.remove = function (val) {
    const index = this.indexOf(val);
    if (index > -1) {
      this.splice(index, 1);
    }
  };

  const swiper = new Swiper('.swiper-container', {
    loop: true,
    autoplay: {
      delay: 5000,
    },
    pagination: {
      el: '.swiper-pagination',
      clickable: true,
    },
  });

  $('#close').on('click', function (){
    $('.container').show();
    $('.fixed-bottom').show();
  });

  $(window).scroll(function () {
    if($(this).scrollTop() > $(window).height()){
      $(".fixed-bottom").fadeIn();
    } else {
      $(".fixed-bottom").fadeOut();
    }
  });

  $('.close-page').on('click', function () {
    WeixinJSBridge.call('closeWindow');
  });

  $('#jump-btn').on('click', function () {
    $('html,body').animate({scrollTop:$('#form-container').offset().top - 50}, 300);
  });

  $('.order').on('click', function (e) {
    e.stopPropagation();
    window.page_position = '泛微定制';
    const mobile = $('#mobile').val();
    const mobile_result = validMobile(mobile);
    switch (mobile_result) {
      case 0:
        showWarnTips('请输入正确的手机号', '#mobile');
        break;
      case 1:
        const data = { customer: $('#customer').val(), building: $('#building').val(), mobile };
        doAppointment(data, function(res) {
          console.log('onAppointmentSuccess', res);
          const { data = '' } = res;
          if(data) {
            buryingPoint('APPOINTMENT', data);
            $('#customer').val("");
            $('#building').val("");
            $('#mobile').val("");
            $('.mask-container').show();
          }
        }, function(err) {
          console.log('onAppointmentError', err);
          $('#customer').val("");
          $('#building').val("");
          $('#mobile').val("");
          layer.msg('预约失败', {
            icon: 5,
            time: 1200
          });
        });
        break;
      case 2:
        showWarnTips('请输入手机号', '#mobile');
        break;
    }
  });

  /**
   * 1:正确，0:格式错误，2:未输入
   * @param number
   */
  function validMobile(number) {
    const isMob = /^1\d{10}$/;
    if (number === "") {
      return 2;
    }
    return isMob.test(number) ? 1 : 0;
  }

  /**
   * 显示提示
   * @param msg
   * @param dom
   */
  function showWarnTips(msg, dom) {
    layer.tips(msg, dom, {
      tips: [1, '#fa8c16'],
      time: 2000
    });
  }

  doStatistics('page', 'zmyj_wxcustomized', Cookies.get('visitor_id'));
</script>
</body>
</html>
